local skel = fk.CreateSkill{
  name = "lb__youyu",
}

Fk:loadTranslationTable{
  ["lb__youyu"] = "游鱼",
  [":lb__youyu"] = "你回合内的每个阶段开始时，若你的手牌数与此前阶段开始时均不同，你可以展示并获得一名其他角色的一张牌，然后交给该角色所有其他手牌；若你未交出牌，你摸一张牌。",

  ["#lb__youyu"] = "游鱼：你可以展示一名其他角色的一张牌，将所有手牌与之交换",

  ["lb__youyu-turn"] = "游鱼",

  ["$lb__youyu1"] = "来捉迷藏呀~",
  ["$lb__youyu2"] = "愚蠢的智者，聪明的愚者~",
  ["$lb__youyu3"] = "好戏开场~",
  ["$lb__youyu4"] = "玩得开心吗？嗯~玩得开心就好~",
}

skel:addEffect(fk.EventPhaseStart, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(skel.name) and target == player
    and table.contains({Player.Start,Player.Judge, Player.Draw, Player.Play, Player.Discard, Player.Finish}, player.phase) then
      local m = player:getTableMark("lb__youyu-turn")
      player.room:addTableMark(player,"lb__youyu-turn",player:getHandcardNum())
      return not table.contains(m,player:getHandcardNum()) --and #m > 0
    end
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local ts = table.filter(room:getOtherPlayers(player),function (p)
      return not p:isNude()
    end)
    if #ts == 0 then return end
    local tos = room:askToChoosePlayers(player,{
      targets = ts,
      min_num = 1,
      max_num = 1,
      skill_name = skel.name,
      prompt = "#lb__youyu",
    })
    event:setCostData(self,{tos = tos})
    return #tos > 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local t = event:getCostData(self).tos[1]
    local c = room:askToChooseCard(player,{
      target = t,
      flag = "he",
      skill_name = skel.name,
    })
    local ids = player:getCardIds("h")
    t:showCards(c)
    room:obtainCard(player,c,true,fk.ReasonPrey,player,skel.name)
    if #ids > 0 then
      room:obtainCard(t,ids,true,fk.ReasonGive,player,skel.name)
    else
      player:drawCards(1,skel.name)
    end
  end,
})

return skel